Each MediaWiki site has a . This is the default interface language for that site. As of October 2007 there are ca. 100 languages for which there is a separate Wikipedia but not yet a language file. These Wikipedias usually have English as default interface language. However, nowadays creating the language file is a condition for opening a new language edition of Wikipedia, see .
Typically the code uses the site language in link targets (function wfMsgForContent), and the user-specified language in other texts, including link labels (function wfMsg).
HTML elements which are not normally passed on to the browser, are when occurring in certain messages.
When viewing a "non-existing" page of which the name is an existing message name, the page shows the default. A "non-existing" page can be recognized by the lack of a history link. The edit page autofills with the default. Transclusion of a "non-existing" page in the MediaWiki namespace trancludes the default.
For the names of all "existing" pages see
For the interface language set in the preferences, all default messages and current versions can be viewed at , with red links to create new deviations from the defaults. When creating a page to override the default it is useful to first save the default version, to allow diffs with it.
Deviating from the default is a bit slower.
An administrator with access to the language files can choose between adapting these and creating pages in the MediaWiki namespace. The latter makes it easier to update to a new version of MediaWiki while keeping the own versions of messages. On the other hand, is easier to transfer a language file to another MediaWiki site than to export and import pages, for the benefit of users who have selected the language concerned as interface language.
An extension can set e.g. message key aaa to bbb by:
global $wgMessageCache;
$wgMessageCache->addMessages( array ('aaa' => 'bbb') );
The key has to start with a lowercase letter, even though message files define messages using an ID written with a capital, and even though the corresponding MediaWiki page has a capital after the colon, in this case MediaWiki:Aaa, even on wikis which allow a lowercase first letter in page names. (The default content of MediaWiki:aaa becomes bbb, but changing it has no effect.)
After getting the array $ma of extension messages:
$ma = $wgMessageCache->getExtensionMessagesFor( 'en' );
the value can be retrieved with $ma'aaa', e.g. by:
$wgOut->addWikiText( $ma['aaa'] );
The result after possible overriding by the contents of the MediaWiki page can be retrieved by wfMsg('aaa').
This applies not only for a message in the strict sense; for example, an extension can allow the user community, through a sysop, to supply parameters in this way; this can even be the name of an extension tag, see e.g. , where the tag <properties> is the default, but e.g. the tag <pr> can be used after creating the page "MediaWiki:propertyTable tag" with the content "pr" (but note that for portability of wikitext across wikis with the same extension this flexibility has also disadvantages).
All characters of namespace prefixes are case-insensitive, so one can write "mediawiki:".
On the other hand, especially for pages MediaWiki:message_ID/language_code the protection is somewhat impractical because administrators do not know all the languages that can be set for the user interface.
If an administrator wishes to allow general editing of a MediaWiki page, a method is to place the message on a template, and transclude the template onto the MediaWiki page.
A few messages can in theory cause the software to stop working if they are changed, for example "linktrail". Therefore and for processing efficiency the effect of page has been disabled: the software ignores its contents, taking the regular expression straight out of the message files.
Each message in the $wgAllMessagesEn array in Messages.php corresponds to a page in the MediaWiki namespace. For example, there is a line in the php file:
'confirmprotect' => 'Confirm protection',
To this corresponds the page , and . When this page is edited the new message is automatically used for say . Similarly has the content Confirmer la protection, note that the page name itself is not translated.
If there is neither a page nor a default the result of "int" is different from "MediaWiki:" even if the user uses the default interface language of the site:
However many messages are not suited for inclusion, because they contain $1 and similar parameters not evaluated by the template parser, or raw and markup not permitted on normal pages.
Instead, one can use in-page interlanguage links on the talk pages, does this for some major MediaWiki wikis.